<pre>
<?php //print_r($docs)?>

<div id="content">
		<div id="inner">
		<table cellspacing="0" cellpadding="4">
			<thead>
				<tr>
					<td width="170px">Название категори</td>

                    <td width="130px"></td>
                    <td>Описание</td>
					<td width="130px">Редактировать</td>
				</tr>
			</thead>
			<tbody class="cat">
			<?php foreach($docs as $doc):?>
				<?=$doc['id']?>
				<tr class="pane" id="<?=$doc['id']?>">
					<th><img src="/res/img/admin/category.gif" class="left" /> <a href="/admin/category/view/<?=$doc['id']?>" class="screenshot" rel="/res/img/category/<?=$doc['thumb']?>"><?=$doc['name']?></a></th>
                    <td><?= $doc['count']; ?> фото</td>
					<td><?=$doc['description']?></td>
					<td class="edit">
                        <a href="/admin/category/add/{$doc.id}/"><img src="/res/img/admin/add_icon.gif" /></a><a href="/admin/category/edit/<?=$doc['id']?>"><img src="/res/img/admin/edit.gif" /></a>
                        <?php if ($doc['parent']): ?><a class="delete" href="#" rel="<?=$doc['name']?>"><img src="/res/img/admin/delete_icon.gif" /></a><?php endif; ?>
                    </td>
				</tr>
			<?php if ($doc['parent']): ?>
				<?php foreach($doc['parent'] as $parent):?>
				<tr class="parent pane" id="{$parent.id}">
					<th><img src="/res/img/admin/sub_category_icon.gif" /><img src="/res/img/admin/subcategory.gif" class="left" /> <a href="/admin/category/view/<?=$parent['$parent.id']?>" class="screenshot" rel="/res/img/category/{$parent.thumb}"><?=$parent['name']?></a></th>
					<td><?=$parent['count']?> фото</td>
                    <td><?=$parent['description']?></td>
					<td class="edit"><img src="/res/img/admin/plus_off.gif" /><a href="/admin/category/edit/<?=$parent['id']?>"><img src="/res/img/admin/edit.gif" /></a> <a class="delete" href="#" rel="<?=$parent['name']?>"><img src="/res/img/admin/delete_icon.gif" /></a></td>
				</tr>
				<?php endforeach; ?>
			<?php endif; ?>
			<?php endforeach; ?>
			</tbody>
		</table>
		</div>
	</div>
<div class="loading px150 center paddingtb paddinglr" style="text-align: center; margin-top: 20px;"><img src="/res/img/admin/preloader.gif" /><br />Отправка данных....</div>
<div class="success"></div>